package com.gyh.stlserver.controller;

import com.gyh.stlserver.constants.Constants;
import com.gyh.stlserver.entity.Room;
import com.gyh.stlserver.service.RoomService;
import com.gyh.stlserver.util.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/room")
public class RoomController {
    @Resource
    private RoomService roomService;

    @GetMapping
    public Result getAllRoom(){
        List<Room> rooms = roomService.getAllRoom();
        return Result.success(Constants.STATUS_200,rooms) ;
    }
}
